Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Dns cross-platform, add reverse methods #325

Merged
merged 4 commits into from
Oct 7, 2021

Conversation

armanbilge
Copy link
Contributor

@armanbilge armanbilge commented Oct 3, 2021

  1. Adds cats-effect-kernel as both a JVM/JS dependency (cats-effect proper was previously a JVM dep)
  2. Makes Dns a sealed trait (assume this is ok?) and adds reverse, reverseOption, and reverseAll methods
  3. Implements Dns for Node.js (as long as browsers don't use Dns they won't have problems)
  4. Adds DnsTest

For context see http4s/http4s#5316 (comment)

}
/** Reverses the supplied address to a hostname using the platform DNS resolver.
*
* If the address cannot be reversed, the effect fails with an `UnknownHostException`.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't sure about this since its a slight abuse, but I don't see why UnknownHostException couldn't apply here as well.

For precedence, Node.js returns the same ENOTFOUND error for both resolve and reverse.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw, JVM instead of returning an error for reverse just returns the IP address as a String ...

@mpilquist mpilquist merged commit 3b94c49 into Comcast:main Oct 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants